package it.ActivityDemo;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class SubActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
Button button = new Button(this);
button.setText("Termina SubActivity");
button.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v) {finish();}});
setContentView(button); }
}
